home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / java / security / PrivilegedExceptionAction.java < prev    next >
Encoding:
Java Source  |  1999-05-28  |  2.0 KB  |  52 lines  |  [TEXT/CWIE]

  1. /*
  2.  * @(#)PrivilegedExceptionAction.java    1.4 98/06/29
  3.  *
  4.  * Copyright 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.security;
  16.  
  17.  
  18. /**
  19.  * A computation to be performed with privileges enabled, that throws one or
  20.  * more checked exceptions.  The computation is performed by invoking
  21.  * <code>AccessController.doPrivileged</code> on the
  22.  * <code>PrivilegedExceptionAction</code> object.  This interface is
  23.  * used only for computations that throw checked exceptions;
  24.  * computations that do not throw
  25.  * checked exceptions should use <code>PrivilegedAction</code> instead.
  26.  *
  27.  * @see AccessController
  28.  * @see AccessController#doPrivileged(PrivilegedExceptionAction)
  29.  * @see AccessController#doPrivileged(PrivilegedExceptionAction,
  30.  *                                              AccessControlContext)
  31.  * @see PrivilegedAction
  32.  */
  33.  
  34. public interface PrivilegedExceptionAction {
  35.     /**
  36.      * Performs the computation.  This method will be called by
  37.      * <code>AccessController.doPrivileged</code> after enabling privileges.
  38.      *
  39.      * @return a class-dependent value that may represent the results of the
  40.      *           computation.  Each class that implements
  41.      *           <code>PrivilegedExceptionAction</code> should document what
  42.      *         (if anything) this value represents.
  43.      * @throws Exception an exceptional condition has occurred.  Each class
  44.      *           that implements <code>PrivilegedExceptionAction</code> should
  45.      *         document the exceptions that its run method can throw.
  46.      * @see AccessController#doPrivileged(PrivilegedExceptionAction)
  47.      * @see AccessController#doPrivileged(PrivilegedExceptionAction,AccessControlContext)
  48.      */
  49.  
  50.     Object run() throws Exception;
  51. }
  52.